package com.astrocsr.domain.web;

import java.util.Date;

import org.apache.commons.lang3.StringUtils;

import com.astrocsr.common.Constants;
import com.astrocsr.common.util.DateUtil;

public class UserInfo implements java.io.Serializable {

	// Fields
	private static final long serialVersionUID = 1L;

	private Long userId;
	private String email;
	private String status;
	private String password;
	private String locked;
	private String enabled;
	private Date datepwChanged;
	private Date dateLastAccessed;
	private String groupCode;
	private String createdBy;
	private Date createdDate;
	private String updatedBy;
	private Date updatedDate;

	// extra
	private String passwordCur;
	private String passwordNew;
	private String passwordVer;
	
	private String role;
	
	// Constructors

	/** default constructor */
	public UserInfo() {
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public Date getCreatedDate() {
		return createdDate;
	}
	
	public String getDisplayCreatedDate() {
		return (createdDate != null)? DateUtil.formatLocalDashTime(createdDate): "";
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public String getUpdatedBy() {
		return updatedBy;
	}

	public void setUpdatedBy(String updatedBy) {
		this.updatedBy = updatedBy;
	}

	public Date getUpdatedDate() {
		return updatedDate;
	}

	public void setUpdatedDate(Date updatedDate) {
		this.updatedDate = updatedDate;
	}

	public String getPasswordCur() {
		return passwordCur;
	}

	public void setPasswordCur(String passwordCur) {
		this.passwordCur = passwordCur;
	}

	public String getPasswordNew() {
		return passwordNew;
	}

	public void setPasswordNew(String passwordNew) {
		this.passwordNew = passwordNew;
	}

	public String getPasswordVer() {
		return passwordVer;
	}

	public void setPasswordVer(String passwordVer) {
		this.passwordVer = passwordVer;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public String getDisplayLocked() {
		if (StringUtils.isNotBlank(locked)) {
			return (Constants.YES.equals(locked)? "True" : "False");
		}
		return locked;
	}

	public String getLocked() {
		return locked;
	}

	public void setLocked(String locked) {
		this.locked = locked;
	}

	public Date getDatepwChanged() {
		return datepwChanged;
	}

	public void setDatepwChanged(Date datepwChanged) {
		this.datepwChanged = datepwChanged;
	}

	public Date getDateLastAccessed() {
		return dateLastAccessed;
	}

	public void setDateLastAccessed(Date dateLastAccessed) {
		this.dateLastAccessed = dateLastAccessed;
	}

	public String getEnabled() {
		return enabled;
	}
	
	public String getDisplayEnabled() {
		if (StringUtils.isNotBlank(enabled)) {
			return (Constants.YES.equals(enabled)? "True" : "False");
		}
		return enabled;
	}

	public void setEnabled(String enabled) {
		this.enabled = enabled;
	}

	public String getGroupCode() {
		return groupCode;
	}

	public void setGroupCode(String groupCode) {
		this.groupCode = groupCode;
	}
 
}